home *** CD-ROM | disk | FTP | other *** search
- package com.ibm.xml.parser;
-
- import org.w3c.dom.DOMException;
- import org.w3c.dom.EntityReference;
- import org.w3c.dom.Node;
-
- public class GeneralReference extends Parent implements EntityReference {
- static final long serialVersionUID = 3555190050476479048L;
- private String name;
-
- public GeneralReference(String var1) {
- this.name = var1;
- }
-
- public Object clone() {
- return this.cloneNode(true);
- }
-
- public synchronized Node cloneNode(boolean var1) {
- ((Child)this).checkFactory();
- GeneralReference var2 = (GeneralReference)super.factory.createEntityReference(this.getName());
- if (var1) {
- var2.children.ensureCapacity(super.children.getLength());
-
- for(int var3 = 0; var3 < super.children.getLength(); ++var3) {
- ((Parent)var2).appendChild(super.children.item(var3).cloneNode(true));
- }
- }
-
- return var2;
- }
-
- public synchronized boolean equals(Node var1, boolean var2) {
- if (var1 == null) {
- return false;
- } else if (!(var1 instanceof GeneralReference)) {
- return false;
- } else {
- GeneralReference var3 = (GeneralReference)var1;
- if (!var3.getName().equals(this.getName())) {
- return false;
- } else {
- return !var2 || var3.children.equals(super.children, var2);
- }
- }
- }
-
- public short getNodeType() {
- return 5;
- }
-
- public String getNodeName() {
- return this.getName();
- }
-
- public String getName() {
- return this.name;
- }
-
- public String getLanguage() {
- if (super.parent == null) {
- return null;
- } else if (super.parent instanceof TXElement) {
- return ((TXElement)super.parent).getLanguage();
- } else {
- return super.parent instanceof GeneralReference ? ((GeneralReference)super.parent).getLanguage() : null;
- }
- }
-
- public void acceptPre(Visitor var1) throws Exception {
- var1.visitGeneralReferencePre(this);
- }
-
- public void acceptPost(Visitor var1) throws Exception {
- var1.visitGeneralReferencePost(this);
- }
-
- protected void checkChildType(Node var1) throws DOMException {
- switch (var1.getNodeType()) {
- case 1:
- case 3:
- case 4:
- case 5:
- case 7:
- case 8:
- case 23:
- return;
- default:
- throw new TXDOMException((short)3, "Specified node type (" + var1.getNodeType() + ") can't be a child of EntityReference.");
- }
- }
-
- public void collectNamespaceAttributes() {
- this.collectNamespaceAttributes(((Child)this).getParentNode());
- }
-
- public void collectNamespaceAttributes(Node var1) {
- if (((Child)this).getFactory().isProcessNamespace()) {
- for(Node var2 = ((Parent)this).getFirstWithoutReference(); var2 != null; var2 = ((Child)var2).getNextWithoutReference()) {
- if (var2.getNodeType() == 1) {
- ((TXElement)var2).collectNamespaceAttributes(var1);
- }
- }
-
- }
- }
-
- public void removeOverlappedNamespaceAttributes() {
- if (((Child)this).getFactory().isProcessNamespace()) {
- for(Node var1 = ((Parent)this).getFirstWithoutReference(); var1 != null; var1 = ((Child)var1).getNextWithoutReference()) {
- if (var1.getNodeType() == 1) {
- ((TXElement)var1).removeOverlappedNamespaceAttributes();
- }
- }
-
- }
- }
- }
-